Xbasic

ATAN2 Function

Syntax

Arc_Tangent_Angle as N = ATAN2(N x,N y)

Arguments

x

A number between - and + .

y

A number between - and + .

Description

Returns an arc tangent angle (in radians) for all four quadrants

Discussion

ATAN2() returns the arc tangent (in radians) for all four quadrants. With this function, you specify the X and Y coordinates, as opposed to specifying the tangent value, as is the case with the ATAN function.

Example

atan2(0,1) -> 0
rtod( atan2(99,99) ) -> 45

See Also